#ifndef RMLOGCLIENT_H
#define RMLOGCLIENT_H

#include <QtCore/qglobal.h>
#include <QUdpSocket>
#include <QThread>
#include <QMutex>

#ifdef RMLOGCLIENT_LIB
# define RMLOGCLIENT_EXPORT Q_DECL_EXPORT
#else
# define RMLOGCLIENT_EXPORT Q_DECL_IMPORT
#endif

#define RMLOG(moduleNo, info) RmLogClient::GetInstance().WriteLog(moduleNo, info)

class RMLOGCLIENT_EXPORT RmLogClient:public QObject
{
public:
	RmLogClient();
	~RmLogClient();

	static RmLogClient & GetInstance();

	void WriteLog(int moduleNo, QString & info);

private:
	QUdpSocket * m_send;
	QMutex * m_mutex;
};

#define MAX_LEN_INFO 252
struct RMLogTime
{
	char hour;
	char min;
	char second;
	short ms;
};

struct RMLogMsg
{
	int moduleNo;

	RMLogTime time;

	char info[MAX_LEN_INFO];
};
#endif // RMLOGCLIENT_H
